Historically, computer graphics initiated in the days of pen plotters and whilst today the drawing method can be a series of pixels on a screen or a series of dots on a printer, the term "pen" will be used throughout.
Axes
The 2D coordinate system used is right-handed as shown below, with the X-axis horizontal, the Y-axis vertical.
The Right Handed Coordinate System
Two-dimensional drawing can be anywhere within X,Y space, with the initial origin being the bottom left-hand corner of the drawing area. Three-dimensional drawing is covered separately, later in this document (see 3D Drawing).
2D Start and End Pen Position
All drawing starts from the position at which the pen was left by the previous drawing instruction - this is termed the start pen position. Initially, the position of the pen is at (X,Y) = (0.0,0.0). The arguments for all 2D drawing routines define the point at which the pen will be left after executing the routine. This is termed the "end pen position". The end position of one routine becomes the start position for the next. The arguments can specify the absolute coordinates of the end pen position, or the end pen position relative to the start position.
Pen Position
2D Naming Conventions
The naming convention for the 2D drawing routines is as follows:
(a) The initial part indicates the routine:
gMove*
- positioning
gDrawLine*
- drawing straight lines
gDrawArc*
- drawing circular arcs
gDrawPolyline*
- drawing a series of straight lines
gDrawPolylineSet*
- drawing a set of polylines
gDrawAkima*
- drawing a curve using an averaging method due to Akima
gDrawCurve*
- drawing a piecewise parametric cubic curve
gDrawSpline*
- drawing a cubic spline curve
(a) The latter part indicates the type of coordinates: